<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>班车页面</title>
		<meta name="renderer" content="webkit">
  		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<!-- 项目基准路径 -->
		<base href="/bestinc/" />
		
		<!-- 引入layui的css -->
		<link rel="stylesheet" href="static/lib/layui/css/layui.css"  media="all">
		
		<!-- 引入自定义工具css -->
		<link rel="stylesheet" href="static/css/util.css"  media="all">
		
		<!-- 引入jqeury -->
		<!-- <script src="js/util/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script> -->
		
		<!-- 引入layui的js -->
		<script src="static/lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
		
		<!-- 引入资源js -->
		<script src="static/js/base/bus/bus.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<!-- 头部搜索框 -->
		<div id="content">
		<div id="search-header">
		  <form class="layui-form">
		      <div class="layui-form-item">
		        <div class="layui-inline">
		          <label class="layui-form-label">班车类型名</label>
		          <div class="layui-input-inline">
		          <!--  <input id="subsetName" type="text" name="subsetName" placeholder="请输入" autocomplete="off" class="layui-input"> -->
		          	<select id="sbName" name="subsetName">
		         		<option value=""></option>
		         	</select>
		          </div>
		        </div>
		        
		        <div class="layui-inline">
		          <label class="layui-form-label">承运商</label>
		          <div class="layui-input-inline">
		          <!--  <input id="acceptTrader" type="text" name="acceptTrader" placeholder="请输入" autocomplete="off" class="layui-input"> -->
		         	<select id="acceptTrader" name="acceptTrader">
		         		<option value=""></option>
		         		<option value="顺丰快递">顺丰快递</option>
		         		<option value="圆通快递">圆通快递</option>
		         		<option value="申通快递">申通快递</option>
		         		<option value="中通快递">中通快递</option>
		         		<option value="韵达快递">韵达快递</option>
		         		<option value="百世快递">百世快递</option>
		         		<option value="天天快递">天天快递</option>
		         		<option value="邮政">邮政</option>
		         	</select>
		          </div>
		        </div>
		        
		        <div class="layui-inline">
		          <label class="layui-form-label"></label>
		           <div class="layui-input-inline">
		            <button class="layui-btn" lay-submit="" lay-filter="busSearchBtn">
		            	<i class="layui-icon layui-icon-search"></i>
		            	查询
		            </button>
		            <button id="reset" class="layui-btn" type="reset" >
		            	<i class="layui-icon layui-icon-refresh"></i>
		            	重置
		            </button>
		          </div>
		        </div>
		      </div>
	      </form>
	    </div>
		
		<div id="dataDiv">
			<!-- 数据表格 -->
			<table class="layui-hide" id="busTable" lay-filter="busTableEvent"></table>
		</div>
		
		
		<!-- 添加模态框 -->
		<div id="addBusModal" class="definedModal">
			<!-- 这里手动加表单样式 -->
			<form id="addBusForm" lay-filter="addBusForm" class="layui-form" action="">
			  <div class="layui-form-item">
			    <label class="layui-form-label">车牌号码</label>
			    <div class="layui-input-block">
			      <input type="text" name="busNumber" lay-verify="required" my-verify="addBusNumber" placeholder="请输入车牌号码" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">线路名</label>
			    <div class="layui-input-block">
			     <input type="text" name="routeName" lay-verify="required" my-verify="addRouteName"  placeholder="请输入线路名" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  
			   <div class="layui-form-item">
			    <label class="layui-form-label">班车类型名</label>
			    <div class="layui-input-block">
			      <!-- <input type="text" name="subsetName" lay-verify="required"  placeholder="请输入班车类型名" autocomplete="off" class="layui-input"> -->
			    	<select id="addSubsetName" name="subsetName">
		         		<option value=""></option>
		         	</select>
			    </div>
			  </div>
			  
			  <div class="layui-form-item">
			    <label class="layui-form-label">司机手机号</label>
			    <div class="layui-input-block">
			      <input type="text" name="staffPhone" lay-verify="required" my-verify="addStaffPhone"  placeholder="请输入司机手机号" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  
			  <div class="layui-form-item">
			    <label class="layui-form-label">承运商</label>
			    <div class="layui-input-block">
			     <!--  <input type="text" name="acceptTrader" lay-verify="required"  placeholder="请输入承运商" autocomplete="off" class="layui-input"> -->
			    	<select id="acceptTrader" name="acceptTrader">
		         		<option value=""></option>
		         		<option value="顺丰快递">顺丰快递</option>
		         		<option value="圆通快递">圆通快递</option>
		         		<option value="申通快递">申通快递</option>
		         		<option value="中通快递">中通快递</option>
		         		<option value="韵达快递">韵达快递</option>
		         		<option value="百世快递">百世快递</option>
		         		<option value="天天快递">天天快递</option>
		         		<option value="邮政">邮政</option>
		         	</select>
			    </div>
			  </div>
			  
			  <div class="layui-form-item">
			    <label class="layui-form-label">吨位</label>
			    <div class="layui-input-block">
			      <input type="text" name="tons" lay-verify="required" my-verify="addTons"  placeholder="请输入吨位" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			
			 <div class="layui-form-item">
			    <label class="layui-form-label">描述</label>
			    <div class="layui-input-block">
			      <input type="text" name="description" lay-verify="aihao"  placeholder="请输入描述" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			
			  <!-- <div class="layui-form-item">
			    <div class="layui-input-block">
			      <button type="submit" class="layui-btn" lay-submit="" lay-filter="addBusBtn" >立即提交</button>
			      <button type="button" class="layui-btn modalClose">关闭</button>
			    </div>
			  </div> -->
			</form>
		</div>
		
		<!-- 修改模态框 -->
		<div id="updateBusModal" class="definedModal">
			<!-- 这里手动加表单样式 -->
			<form id="updateBusForm" lay-filter="updateBusForm" class="layui-form" action="">
			  <input type="hidden" name="_method" value="PUT"/>
			  <input type="hidden" name="busId"/>
			  <div class="layui-form-item">
			    <label class="layui-form-label">车牌号码</label>
			    <div class="layui-input-block">
			      <input type="text" name="busNumber" lay-verify="aihao" my-verify="updateBusNumber" placeholder="请输入车牌号码" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">线路名</label>
			    <div class="layui-input-block">
			     <input type="text" name="routeName" lay-verify="aihao" my-verify="updateRouteName"  placeholder="请输入线路名" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  
			  <div class="layui-form-item">
			    <label class="layui-form-label">班车类型名</label>
			    <div class="layui-input-block">
			     <!-- <input type="text" name="subsetName" lay-verify="aihao"  placeholder="请输入班车类型名" autocomplete="off" class="layui-input"> -->
			    	<select id="updateSubsetbName" name="subsetName">
		         		<option value=""></option>
		         	</select>
			    </div>
			  </div>
			  
			  <div class="layui-form-item">
			    <label class="layui-form-label">司机手机号</label>
			    <div class="layui-input-block">
			     <input type="text" name="staffPhone" lay-verify="aihao" my-verify="updateStaffPhone"  placeholder="请输入司机手机号" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  
			  <div class="layui-form-item">
			    <label class="layui-form-label">承运商</label>
			    <div class="layui-input-block">
			     <!-- <input type="text" name="acceptTrader" lay-verify="aihao"  placeholder="请输入承运商" autocomplete="off" class="layui-input"> -->
			   		<select id="acceptTrader" name="acceptTrader">
		         		<option value=""></option>
		         		<option value="顺丰快递">顺丰快递</option>
		         		<option value="圆通快递">圆通快递</option>
		         		<option value="申通快递">申通快递</option>
		         		<option value="中通快递">中通快递</option>
		         		<option value="韵达快递">韵达快递</option>
		         		<option value="百世快递">百世快递</option>
		         		<option value="天天快递">天天快递</option>
		         		<option value="邮政">邮政</option>
		         	</select>
			    </div>
			  </div>
			  
			  <div class="layui-form-item">
			    <label class="layui-form-label">吨位</label>
			    <div class="layui-input-block">
			     <input type="text" name="tons" lay-verify="aihao" my-verify="updateTons"  placeholder="请输入吨位" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  
			  <div class="layui-form-item">
			    <label class="layui-form-label">描述</label>
			    <div class="layui-input-block">
			      <input type="text" name="description" lay-verify="aihao"  placeholder="请输入描述" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			 <!--  <div class="layui-form-item">
			    <div class="layui-input-block">
			      <button type="submit" class="layui-btn" lay-submit="" lay-filter="updateBusBtn">立即提交</button>
			      <button type="button" class="layui-btn modalClose">关闭</button>
			    </div>
			  </div> -->
			</form>
		</div>
		
	    <!-- 头部工具栏 -->
		<script type="text/html" id="busToolbar">
  			<div class="layui-btn-group">
 				<button lay-event="addBus" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon">&#xe654;</i>添加</button>
				<button lay-event="updateBus" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon">&#xe642</i>修改</button>
    			<button lay-event="frozenBus" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon">&#xe640;</i>冻结</button>
				<button lay-event="recoverBus" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon">&#xe669;</i>还原</button>
  			</div>
		</script>
		
		<!-- 状态 -->
		<script type="text/html" id="checkboxTpl">
    		<span {{d.useable=='Y'? 'class="useable font-color font-size my-bg-green"': 'class="useable font-color font-size my-bg-red"'}}>{{d.useable=='Y'?'可用':'禁用'}}</span>
		</script>
		
		<!-- 工具栏列 -->
		<script type="text/html" id="busBar">
  			<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  			<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
		</script>
		
		<!-- 资源的树形表格 -->
		<!-- <script type="text/javascript" charset="utf-8">
		    layui.config({
		        base: 'js/'
		    }).extend({
		        treeTable: 'treeTable/treeTable'
		    }).use(['layer', 'util', 'treeTable'], function () {
		        var $ = layui.jquery;
		        var layer = layui.layer;
		        var util = layui.util;
		        var treeTable = layui.treeTable;
		        
		        treeTable.render({
		            elem: '#roleTable',
		            toolbar: '#roleToolbar', //开启头部工具栏，并为其绑定左侧模板
		            cellMinWidth: 60, //全局定义所有常规单元格的最小宽度（默认：60）
		            tree: {
		                iconIndex: 2,  // 折叠图标显示在第几列
		                arrowType: 'arrow2', // 折叠图标
		                idName: 'roleId',  // 自定义id字段的名称
		                //pidName: 'parentId',  // 自定义标识是否还有子节点的字段名称
		                haveChildName: 'haveChild',  // 自定义标识是否还有子节点的字段名称
		            },
		            cols: [
		                {type:'numbers'} //序号
		                ,{type: 'checkbox'} //复选框
		                ,{field:'roleName', title:'资源名'}
		                ,{field:'abbr', title:'资源简称'}
		                ,{field:'roleUrl', title:'资源路径'}
		                ,{field:'roleType', title:'资源类型', templet: function(d){
		                    return d.roleType == "menu" ? "菜单" : "按钮";
		                }}
		                ,{field:'roleLevel', title: '资源等级'}
		                ,{field:'roleDesc', title:'资源描述'}
		                ,{field:'useable', title:'状态', width:110, templet: '#checkboxTpl', unresize: true}
		                ,{align: 'center', toolbar: '#roleBar', title: '操作', width: 120}
		            ],
		            reqData: function(data, callback) { //异步获得数据
		            	setTimeout(function () {  // 故意延迟一下
			            	//拿到当前行的id 0000000000000000
			            	var roleId = data ? data.roleId : '0000000000000000';
			                $.get('sys/queryRoleLazy?roleId=' + roleId, function (res) {
			                    callback(res);
			                });
		            	}, 500);
		            },
		            style: 'margin-top:0;' //设置表格样式
		        });
		        
		    });
	</script> -->
	</div>
	</body>
</html>
